package com.zzyl.job;

import com.zzyl.service.AlertRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AlertJob {


    @Autowired
    private AlertRuleService alertRuleService;

    //@Scheduled(fixedDelay = 30000) //每隔30秒执行一次
    @Scheduled(fixedRate = 30000) //每隔1分钟执行一次
    @Scheduled(cron = "0 0/1 * * * ?") //每隔1分钟执行一次
    @Scheduled(cron = "0,30 * * * * ?") //每隔30秒执行一次
    public void deviceDataAlertFilter(){
        alertRuleService.deviceDataAlertFilter();
    }

}
